home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Macintosh Easy Open / Documentation / Developer / Interfaces / CIncludes / TranslationExtensions.h < prev   
Encoding:
C/C++ Source or Header  |  1994-12-12  |  4.4 KB  |  155 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TranslationExtensions.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Built by:            anonymous
  8.                  From:                TranslationExtensions.i, revision 4, dated 5/31/94
  9.                  With Interfacer:    1.1d4e2
  10.  
  11.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  12.                  List the version information from above in Problem Description.
  13.  
  14. */
  15.  
  16. #ifndef __TRANSLATIONEXTENSIONS__
  17. #define __TRANSLATIONEXTENSIONS__
  18.  
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #define kSupportsFileTranslation 1
  25.  
  26. #define kSupportsScrapTranslation 2
  27.  
  28. #define kTranslatorCanGenerateFilename 4
  29.  
  30. #ifndef REZ
  31.  
  32. #ifndef __MEMORY__
  33. #include <Memory.h>
  34. #endif
  35. /*    #include <Types.h>                                            */
  36. /*        #include <ConditionalMacros.h>                            */
  37. /*        #include <MixedMode.h>                                    */
  38. /*            #include <Traps.h>                                    */
  39.  
  40. #ifndef __FILES__
  41. #include <Files.h>
  42. #endif
  43. /*    #include <OSUtils.h>                                        */
  44. /*    #include <SegLoad.h>                                        */
  45.  
  46. #ifndef __QUICKDRAW__
  47. #include <Quickdraw.h>
  48. #endif
  49. /*    #include <QuickdrawText.h>                                    */
  50. /*        #include <IntlResources.h>                                */
  51.  
  52. #ifndef __COMPONENTS__
  53. #include "Components.h"
  54. #endif
  55. typedef OSType FileType;
  56.  
  57. typedef ResType ScrapType;
  58.  
  59. typedef unsigned long TranslationAttributes;
  60.  
  61. #define taDstDocNeedsResourceFork 1
  62.  
  63. #define taDstIsAppTranslation 2
  64.  
  65. #if defined(powerc) || defined (__powerc)
  66. #pragma options align=mac68k
  67. #endif
  68. struct FileTypeSpec {
  69.     FileType                        format;
  70.     long                            hint;
  71.     TranslationAttributes            flags;
  72.     OSType                            catInfoType;
  73.     OSType                            catInfoCreator;
  74. };
  75. #if defined(powerc) || defined(__powerc)
  76. #pragma options align=reset
  77. #endif
  78.  
  79. typedef struct FileTypeSpec FileTypeSpec;
  80.  
  81. #if defined(powerc) || defined (__powerc)
  82. #pragma options align=mac68k
  83. #endif
  84. struct FileTranslationList {
  85.     unsigned long                    modDate;
  86.     unsigned long                    groupCount;
  87. };
  88. #if defined(powerc) || defined(__powerc)
  89. #pragma options align=reset
  90. #endif
  91.  
  92. typedef struct FileTranslationList FileTranslationList;
  93.  
  94. typedef FileTranslationList *FileTranslationListPtr, **FileTranslationListHandle;
  95.  
  96. #if defined(powerc) || defined (__powerc)
  97. #pragma options align=mac68k
  98. #endif
  99. struct ScrapTypeSpec {
  100.     ScrapType                        format;
  101.     long                            hint;
  102. };
  103. #if defined(powerc) || defined(__powerc)
  104. #pragma options align=reset
  105. #endif
  106.  
  107. typedef struct ScrapTypeSpec ScrapTypeSpec;
  108.  
  109. #if defined(powerc) || defined (__powerc)
  110. #pragma options align=mac68k
  111. #endif
  112. struct ScrapTranslationList {
  113.     unsigned long                    modDate;
  114.     unsigned long                    groupCount;
  115. };
  116. #if defined(powerc) || defined(__powerc)
  117. #pragma options align=reset
  118. #endif
  119.  
  120. typedef struct ScrapTranslationList ScrapTranslationList;
  121.  
  122. typedef ScrapTranslationList *ScrapTranslationListPtr, **ScrapTranslationListHandle;
  123.  
  124. typedef long TranslationRefNum;
  125.  
  126. extern pascal OSErr SetTranslationAdvertisement(TranslationRefNum refNum, PicHandle advertisement)
  127.  TWOWORDINLINE(0x7002, 0xABFC);
  128. extern pascal OSErr UpdateTranslationProgress(TranslationRefNum refNum, short percentDone, Boolean *canceled)
  129.  TWOWORDINLINE(0x7001, 0xABFC);
  130.  
  131. enum {
  132.     kTranslateGetFileTranslationList = 0,
  133.     kTranslateIdentifyFile,
  134.     kTranslateTranslateFile,
  135.     kTranslateGetTranslatedFilename,
  136.     kTranslateGetScrapTranslationList = 10,
  137.     kTranslateIdentifyScrap,
  138.     kTranslateTranslateScrap
  139. };
  140.  
  141. typedef pascal ComponentResult (*DoGetFileTranslationListProcPtr)(ComponentInstance self, FileTranslationListHandle translationList);
  142. typedef pascal ComponentResult (*DoIdentifyFileProcPtr)(ComponentInstance self, const FSSpec *theDocument, FileType *docType);
  143. typedef pascal ComponentResult (*DoTranslateFileProcPtr)(ComponentInstance self, TranslationRefNum refNum, const FSSpec *sourceDocument, FileType srcType, long srcTypeHint, const FSSpec *dstDoc, FileType dstType, long dstTypeHint);
  144. typedef pascal ComponentResult (*DoGetTranslatedFilenameProcPtr)(ComponentInstance self, FileType dstType, long dstTypeHint, FSSpec *theDocument);
  145. typedef pascal ComponentResult (*DoGetScrapTranslationListProcPtr)(ComponentInstance self, ScrapTranslationListHandle list);
  146. typedef pascal ComponentResult (*DoIdentifyScrapProcPtr)(ComponentInstance self, const void *dataPtr, Size dataLength, ScrapType *dataFormat);
  147. typedef pascal ComponentResult (*DoTranslateScrapProcPtr)(ComponentInstance self, TranslationRefNum refNum, const void *srcDataPtr, Size srcDataLength, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint);
  148. #endif
  149.  
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153.  
  154. #endif /* __TRANSLATIONEXTENSIONS__ */
  155.